//
//  RootTool.swift
//  开心微博
//
//  Created by 郑开心 on 15/12/10.
//  Copyright © 2015年 郑开心. All rights reserved.
//

import UIKit
private let VersionKey : String = "VersionKey"
class RootTool: NSObject {
    
    class func chooseRootViewController(window: UIWindow){
        
        let currentVesion  = NSBundle.mainBundle().infoDictionary!["CFBundleVersion"] as? String
        
        let lastVesion = NSUserDefaults.standardUserDefaults().objectForKey(VersionKey) as? String
        if currentVesion != lastVesion {
            let newFeature = NewFeatureController()
            window.rootViewController = newFeature
            NSUserDefaults.standardUserDefaults().setObject(currentVesion, forKey: VersionKey)
        }else{
            let tabBarVc = KXTabBarController()
            window.rootViewController = tabBarVc
        }
        
    }
    
    class func chooseOauthView(window: UIWindow){
        let oauthVc = OAuthViewController()
        window.rootViewController = oauthVc
    }
}
